  2 
  3 # Create your models here.
  4 
  5 
  6 class Product(models.Model):                                                
  7     pro_name = models.CharField(max_length = 50)
  8     pro_classs = models.CharField(max_length = 50)                          
  9     pro_size = models.IntegerField(primary_kry = True)
 10     address = models.ForeignKey(Address)                                    
 11     delivery_person = models.ManyToOneRel(Person)
 12     def __str__(self):                                                      
 13         return self.name                                                    
 14     #python3 define __str__()                                               
 15     def __unicode__():                                                      
 16         return self.pro_name                                                
 17     class Meta:                                                             
 18         manage = False                                                      
 19                                                                             
 20                                                                             
 21 class Person(models.Mode):                                                  
 22     person_name = models.CharField(max_length = 50)                         
 23     person_sex = models.CharField(max_length = 5)                           
 24     person_id = models.IntegerField(primary_key = True)                     
 25     person_address =models.ForeignKey(Address)                              
 26     def _-str___(self):                                                     
 27         return self.name                                                    
 28 #python3 define ___str__ function                                           
 29     def __unicoude__(self):                                                 
 30         return self.person_id                                               
 31     class Meta:                                                             
 32         manage = False                                                      
 33                                                                             
 34                                                                             
 35 class Address(models.Model):                                                
 36     start_address = models.CharField(max_length = 50)                       
 37     end_address = models.CharField(max_length = 50)                         
 38                                                                             
 39     def __str__(self):                                                      
 40         return self.name                                                    
 41     def __unicode__(self):                                                  
 42         return self.start_address and self.end_address
